package com.gym.myshop.util;
//字符串工具类 判定字符串是否为空
public class StrUtils {
	public static boolean isNotEmpty(String msg){
		return msg!=null && msg.length()>0;
	}
	public static boolean isNotEmpty(String...msg){
		boolean res = true;
		for(String s:msg){
			res = (s!=null && s.length()>0);
			if(!res){
				break;
			}
		}
		return res;
	}

	/**
	 *@author:ming
	 *@Date: 2021/11/6
	 *@description:获取主键
	 */
	public static Integer toInt(String num){
		if (isNotEmpty(num)) {
			try {
				return Integer.valueOf(num);
			} catch (NumberFormatException e) {
				e.printStackTrace();
			}
		}
		return 0;
	}
}
